# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=tracker
pkgver=2.0.1
pkgrel=1
pkgdesc="Desktop-neutral user information store, search tool and indexer"
url="https://wiki.gnome.org/Projects/Tracker"
arch=(i686 x86_64)
license=(GPL)
depends=(sqlite icu glib2 libffi util-linux libstemmer libseccomp libsoup json-glib upower libnm)
makedepends=(python2 gobject-introspection intltool vala git gtk-doc bash-completion)
groups=(gnome)
_commit=3096d13c3e47b4ff5d8ac0cfffcd19444556350e  # tags/2.0.1^0
source=("git+https://git.gnome.org/browse/tracker#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib/$pkgname \
    --enable-unit-tests \
    --enable-functional-tests \
    --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  # Some tests only work with the schemas installed
  dbus-run-session make -k check || :
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  rm -r "$pkgdir/usr/share/tracker-tests"
}
